garmin_fs: Add support for additional fields 'phone_nr2', 'fax_nr' and 'email'.
authoroliskoli <oliskoli>
Mon, 23 Jun 2008 19:11:55 +0000 (19:11 +0000)
committeroliskoli <oliskoli>
Mon, 23 Jun 2008 19:11:55 +0000 (19:11 +0000)
garmin_fs.c
garmin_fs.h

index 76a65aa8d31ca7d8156413489443b3550c41c8e6..f980a51966e3a32772e8e6d35f3decf2d85f2d5a 100644 (file)
@@ -66,6 +66,9 @@ garmin_fs_destroy(void *fs)
                if (data->cross_road != NULL) xfree(data->cross_road);
                if (data->facility != NULL) xfree(data->facility);
                if (data->phone_nr != NULL) xfree(data->phone_nr);
+               if (data->phone_nr2 != NULL) xfree(data->phone_nr2);
+               if (data->fax_nr != NULL) xfree(data->fax_nr);
+               if (data->email != NULL) xfree(data->email);
                if (data->postal_code != NULL) xfree(data->postal_code);
                if (data->state != NULL) xfree(data->state);
 
@@ -104,6 +107,9 @@ void garmin_fs_copy(garmin_fs_t **dest, garmin_fs_t *src)
        (*dest)->cross_road = (src->cross_road != NULL) ? xstrdup(src->cross_road) : NULL;
        (*dest)->facility = (src->facility != NULL) ? xstrdup(src->facility) : NULL;
        (*dest)->phone_nr = (src->phone_nr != NULL) ? xstrdup(src->phone_nr) : NULL;
+       (*dest)->phone_nr2 = (src->phone_nr2 != NULL) ? xstrdup(src->phone_nr2) : NULL;
+       (*dest)->fax_nr = (src->fax_nr != NULL) ? xstrdup(src->fax_nr) : NULL;
+       (*dest)->email = (src->email != NULL) ? xstrdup(src->email) : NULL;
        (*dest)->postal_code = (src->postal_code != NULL) ? xstrdup(src->postal_code) : NULL;
        (*dest)->state = (src->state != NULL) ? xstrdup(src->state) : NULL;
 }
@@ -119,6 +125,9 @@ void garmin_fs_convert(void *fs)
        if (gmsd->cross_road) gmsd->cross_road = cet_convert_string(gmsd->cross_road);
        if (gmsd->facility) gmsd->facility = cet_convert_string(gmsd->facility);
        if (gmsd->phone_nr) gmsd->phone_nr = cet_convert_string(gmsd->phone_nr);
+       if (gmsd->phone_nr2) gmsd->phone_nr2 = cet_convert_string(gmsd->phone_nr2);
+       if (gmsd->fax_nr) gmsd->fax_nr = cet_convert_string(gmsd->fax_nr);
+       if (gmsd->email) gmsd->email = cet_convert_string(gmsd->email);
        if (gmsd->postal_code) gmsd->postal_code = cet_convert_string(gmsd->postal_code);
        if (gmsd->state) gmsd->state = cet_convert_string(gmsd->state);
 }
index c1999e1d98940640ef856d0a8b71a11bb200360a..568faa8495fe4d44ad409ced0b91288f2fa55060 100644 (file)
@@ -77,7 +77,10 @@ typedef struct {
        unsigned int addr:1;
        unsigned int country:1;
        unsigned int phone_nr:1;
+       unsigned int phone_nr2:1;
+       unsigned int fax_nr:1;
        unsigned int postal_code:1;
+       unsigned int email:1;
 #ifdef GMSD_EXPERIMENTAL
        unsigned int subclass:1;
 #endif
@@ -102,7 +105,10 @@ typedef struct garmin_fs_s
        char *addr;                     /* address + number */
        char *country;                  /* country */
        char *phone_nr;                 /* phone number */
+       char *phone_nr2;                /* phone number (2) */
+       char *fax_nr;                   /* fax number */
        char *postal_code;              /* postal code */
+       char *email;                    /* email address */
        garmin_ilink_t *ilinks;
 #ifdef GMSD_EXPERIMENTAL
        char subclass[22];